﻿<catel:DataWindow x:Class="Catel.Examples.WPF.Prism.Modules.Employees.Views.EmployeeWindow"
                  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                  xmlns:catel="http://catel.codeplex.com"
                  xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity">

    <catel:DataWindow.Background>
        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
            <GradientStop Offset="0" Color="#fbfcfd" />
            <GradientStop Offset="1" Color="#e0e3e7" />
        </LinearGradientBrush>
    </catel:DataWindow.Background>

    <!--  Resources  -->
    <catel:DataWindow.Resources />

    <!--  Content  -->
    <catel:StackGrid>
        <catel:StackGrid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </catel:StackGrid.RowDefinitions>

        <catel:StackGrid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" MinWidth="200" />
        </catel:StackGrid.ColumnDefinitions>

        <Label Content="First name:" />
        <TextBox Text="{Binding FirstName, ValidatesOnDataErrors=True, NotifyOnValidationError=True}">
            <i:Interaction.Behaviors>
                <catel:UpdateBindingOnTextChanged UpdateDelay="100" />
                <catel:SelectTextOnFocus />
            </i:Interaction.Behaviors>
        </TextBox>

        <Label Content="Last name:" />
        <TextBox Text="{Binding LastName, ValidatesOnDataErrors=True, NotifyOnValidationError=True}">
            <i:Interaction.Behaviors>
                <catel:UpdateBindingOnTextChanged UpdateDelay="100" />
                <catel:SelectTextOnFocus />
            </i:Interaction.Behaviors>
        </TextBox>

        <Label Content="Department:" />
        <ComboBox DisplayMemberPath="Name"
                  ItemsSource="{Binding AvailableDepartments}"
                  SelectedItem="{Binding Department,
                                         Mode=TwoWay,
                                         ValidatesOnDataErrors=True,
                                         NotifyOnValidationError=True}" />
    </catel:StackGrid>
</catel:DataWindow>
